import sqlite3

# 查询数据（一条数据）
con = sqlite3.connect("db1.db")
sql = 'select * from t_person'
cursor = con.cursor()

try:
    cursor.execute(sql)
    person = cursor.fetchone()
    print(person)
except Exception as e:
    print(e)
    print("查询数据失败")
finally:
    cursor.close()
    con.close()